package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * StopFly generated by hbm2java
 */
@Entity
@Table(name = "stop_fly")
public class StopFly implements java.io.Serializable {

	private Long id;
	private UserBaseInfoMainPoint userBaseInfoMainPoint;
	private Student student;
	private Organize organize;
	private String cause;
	private Date beginDate;
	private Date stopDate;
	private byte status;
	private String fileNumber;
	private Set<StopAccessory> stopAccessories = new HashSet<StopAccessory>(0);
	private Set<StopFlyOpinion> stopFlyOpinions = new HashSet<StopFlyOpinion>(0);

	public StopFly() {
	}

	public StopFly(Student student, byte status) {
		this.student = student;
		this.status = status;
	}

	public StopFly(UserBaseInfoMainPoint userBaseInfoMainPoint,
			Student student, Organize organize, String cause, Date beginDate,
			Date stopDate, byte status, String fileNumber,
			Set<StopAccessory> stopAccessories,
			Set<StopFlyOpinion> stopFlyOpinions) {
		this.userBaseInfoMainPoint = userBaseInfoMainPoint;
		this.student = student;
		this.organize = organize;
		this.cause = cause;
		this.beginDate = beginDate;
		this.stopDate = stopDate;
		this.status = status;
		this.fileNumber = fileNumber;
		this.stopAccessories = stopAccessories;
		this.stopFlyOpinions = stopFlyOpinions;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STUDY_POINT")
	public UserBaseInfoMainPoint getUserBaseInfoMainPoint() {
		return this.userBaseInfoMainPoint;
	}

	public void setUserBaseInfoMainPoint(
			UserBaseInfoMainPoint userBaseInfoMainPoint) {
		this.userBaseInfoMainPoint = userBaseInfoMainPoint;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "STUDENT_ID", nullable = false)
	public Student getStudent() {
		return this.student;
	}

	public void setStudent(Student student) {
		this.student = student;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TRAIN_ORGANIZE")
	public Organize getOrganize() {
		return this.organize;
	}

	public void setOrganize(Organize organize) {
		this.organize = organize;
	}

	@Column(name = "CAUSE", length = 30)
	public String getCause() {
		return this.cause;
	}

	public void setCause(String cause) {
		this.cause = cause;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "BEGIN_DATE", length = 19)
	public Date getBeginDate() {
		return this.beginDate;
	}

	public void setBeginDate(Date beginDate) {
		this.beginDate = beginDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "STOP_DATE", length = 19)
	public Date getStopDate() {
		return this.stopDate;
	}

	public void setStopDate(Date stopDate) {
		this.stopDate = stopDate;
	}

	@Column(name = "STATUS", nullable = false)
	public byte getStatus() {
		return this.status;
	}

	public void setStatus(byte status) {
		this.status = status;
	}

	@Column(name = "FILE_NUMBER", length = 50)
	public String getFileNumber() {
		return this.fileNumber;
	}

	public void setFileNumber(String fileNumber) {
		this.fileNumber = fileNumber;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "stopFly")
	public Set<StopAccessory> getStopAccessories() {
		return this.stopAccessories;
	}

	public void setStopAccessories(Set<StopAccessory> stopAccessories) {
		this.stopAccessories = stopAccessories;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "stopFly")
	public Set<StopFlyOpinion> getStopFlyOpinions() {
		return this.stopFlyOpinions;
	}

	public void setStopFlyOpinions(Set<StopFlyOpinion> stopFlyOpinions) {
		this.stopFlyOpinions = stopFlyOpinions;
	}

}
